package io.renren.htby.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class KafkaConsumeUtils {

	/** kafka配置 */
	public static String bootstrapServers;
	public static String enable_auto_commit;
	public static String auto_offset_reset;
	public static String session_timeout_ms;
	public static String auto_commit_interval_ms;
	public static String key_deserializer;
	public static String value_deserializer;
	public static String group_id;
	public static String dis_group_id;//分发系统 组
	
	/** 监控系统 组 */
	public static String monitro_group_id;
	/** kafka 监控系统：内存、cpu的 topic */
	public static String monitor_topic;
	
	/** 心跳 topic */
	public static String hearbeat_topic;
	/** 心跳 key */
	public static String hearbeat_key;
	/** 心跳 group_id */
	public static String hearbeat_group_id;
	
	/** 设备状态 topic */
	public static String eqm_state_topic;
	/** 设备状态 group_id */
	public static String eqm_state_group_id;
	
	
	@Value("${kafka.eqm.state.topic}")
	public void setEqmStateTopic(String eqm_state_topic) {
		KafkaConsumeUtils.eqm_state_topic = eqm_state_topic;
	}
	
	@Value("${kafka.eqm.state.group.id}")
	public void setEqmStateGroupId(String eqm_state_group_id) {
		KafkaConsumeUtils.eqm_state_group_id = eqm_state_group_id;
	}
	
	@Value("${kafka.hearbeat.group.id}")
	public void setHearbeatGroupId(String hearbeat_group_id) {
		KafkaConsumeUtils.hearbeat_group_id = hearbeat_group_id;
	}
	
	@Value("${kafka.hearbeat.key}")
	public void setHearbeatKey(String hearbeat_key) {
		KafkaConsumeUtils.hearbeat_key = hearbeat_key;
	}
	
	@Value("${kafka.hearbeat.topic}")
	public void setHearbeatTopic(String hearbeat_topic) {
		KafkaConsumeUtils.hearbeat_topic = hearbeat_topic;
	}
	
	@Value("${kafka.monitorServerConfig.monitor_topic}")
	public void setMonitorTopic(String monitor_topic) {
		KafkaConsumeUtils.monitor_topic = monitor_topic;
	}
	
	@Value("${kafka.monitorServerConfig.group.id}")
	public void setMonitorGroupId(String monitro_group_id) {
		KafkaConsumeUtils.monitro_group_id = monitro_group_id;
	}
	
	@Value("${kafka.disServerConfig.group.id}")
	public void setDisGroupId(String dis_group_id) {
		KafkaConsumeUtils.dis_group_id = dis_group_id;
	}
	
	@Value("${kafka.consume.group.id}")
	public void setGroupId(String group_id) {
		KafkaConsumeUtils.group_id = group_id;
	}
	
	@Value("${kafka.consume.bootstrap.servers}")
	public void setBootstrapServers(String bootstrapServers) {
		KafkaConsumeUtils.bootstrapServers = bootstrapServers;
	}

	@Value("${kafka.consume.enable.auto.commit}")
	public void setEnableAutoCommit(String enable_auto_commit) {
		KafkaConsumeUtils.enable_auto_commit = enable_auto_commit;
	}

	@Value("${kafka.consume.auto.offset.reset}")
	public void setAutoOffsetReset(String auto_offset_reset) {
		KafkaConsumeUtils.auto_offset_reset = auto_offset_reset;
	}

	@Value("${kafka.consume.session.timeout.ms}")
	public void setSessionTimeoutMs(String session_timeout_ms) {
		KafkaConsumeUtils.session_timeout_ms = session_timeout_ms;
	}

	@Value("${kafka.consume.auto.commit.interval.ms}")
	public void setAutoCommitIntervalMs(String auto_commit_interval_ms) {
		KafkaConsumeUtils.auto_commit_interval_ms = auto_commit_interval_ms;
	}

	@Value("${kafka.consume.value.deserializer}")
	public void setValueDeserializer(String value_deserializer) {
		KafkaConsumeUtils.value_deserializer = value_deserializer;
	}

	@Value("${kafka.consume.key.deserializer}")
	public void setKeyDeserializer(String key_deserializer) {
		KafkaConsumeUtils.key_deserializer = key_deserializer;
	}
}
